using System;
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;

[Serializable]
public class GT_NodePropertyView : GT_ViewBase
{
    #region Public Variables
    public bool showProperties = false;
    #endregion

    #region Protected Variables
    #endregion

    #region Constructor
    public GT_NodePropertyView() : base("Property View") { }
    #endregion

    #region Main Methods
    public override void UpdateView(Rect editorRect, Rect precentageRect, Event e, GT_NodeGraph curGraph)
    {
        base.UpdateView(editorRect, precentageRect, e, curGraph);
        GUI.Box(viewRect, viewTitle, viewSkin.GetStyle("ViewBG"));

        //Start drawing view GUI
        GUILayout.BeginArea(viewRect);
        GUILayout.Space(60);
        GUILayout.BeginHorizontal();
        GUILayout.Space(30);
        if (curGraph!=null)
        {
            if (!curGraph.showProperties)
            {
                EditorGUILayout.LabelField("NONE");
            }
            else
            {
                curGraph.selectedNode.DrawNodeProperties();
            }
        }

        GUILayout.Space(30);
        GUILayout.EndHorizontal();
        GUILayout.EndArea();

        //Process our Events
        ProgressEvent(e);
    }

    public override void ProgressEvent(Event e)
    {
        base.ProgressEvent(e);

        if (viewRect.Contains(e.mousePosition))
        {
            Debug.Log("Inside:" + viewTitle);
        }
    }
    #endregion

    #region Utility Methods
    #endregion
}
